package com.cg.asm.core.controller.help;

import com.alibaba.fastjson.JSONObject;
import com.cg.asm.core.config.loading.cache.auth.IAuthApi;
import com.cg.asm.client.CommonUtil;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/help/setting")
public class SysSettingController {

    private IAuthApi authApi;

    public SysSettingController(IAuthApi authApi) {
        this.authApi = authApi;
    }

    @ApiOperation(value = "刷新API授权缓存", notes = "API授权信息")
    @GetMapping("/refreshAuthApi")
    public JSONObject refreshAuthApi() {
        authApi.initAuth();
        return CommonUtil.successJson("API授权缓存刷新完成");
    }
}
